package com.edu.medicalpro.mvp.model;

import com.edu.medicalpro.bean.Doctor1;
import com.edu.medicalpro.bean.DoctorData;
import com.edu.medicalpro.bean.PatientResult;
import com.edu.medicalpro.bean.User;
import com.edu.medicalpro.bean.YIYuanJiesShao;
import com.edu.medicalpro.mvp.HomeContrace;
import com.edu.medicalpro.network.RetrofitClient;
import com.edu.medicalpro.retrofit.DoctorService;
import com.edu.medicalpro.retrofit.YIYuanJieShaoRequest;
import com.edu.medicalpro.retrofit.addPatientInfoservice;
import com.edu.medicalpro.retrofit.loginService;

import io.reactivex.rxjava3.core.Flowable;
import io.reactivex.rxjava3.core.Observable;


public class HomeModel implements HomeContrace.IHomeModel {
    @Override
    public Flowable<User> login(String name, String password) {
                return RetrofitClient.getInstance()
                .getService(loginService.class).Login(name,password);
    }

    @Override
    public Observable<PatientResult> addPatient(Doctor1 doctor1) {
        return RetrofitClient.getInstance()
                .getService(addPatientInfoservice.class).addPatient(doctor1);
    }
    @Override
    public Flowable<DoctorData> getDoctor(int pageNum, int pageSize) {
        return RetrofitClient.getInstance()
                .getService(DoctorService.class).Login(pageNum,pageSize);
    }

    @Override
    public Observable<YIYuanJiesShao<YIYuanJiesShao.DeanInfoBean>> getYYJS() {
        return RetrofitClient.getInstance()
                .getService(YIYuanJieShaoRequest.class).requestYiYuanJieShao();
    }


}
